import { Controller, Get, Post, Put, Patch, Delete, Body, Param } from '@nestjs/common';
import { ReplyFormService } from '../services/replyform.service';
import { ReplyForm } from '../entities/replyform.entity';
import { AskFormService } from '../services/askform.service';
import { AskForm } from '../entities/askform.entity';

@Controller('replyforms')
export class ReplyFormController {
    constructor(private readonly replyFormService: ReplyFormService) {}

    @Get()
    async findAll(): Promise<ReplyForm[]> {
        return this.replyFormService.findAll();
    }

    @Get(':id')
    async findOne(@Param('id') id: number): Promise<ReplyForm> {
        return this.replyFormService.findOne(id);
    }

    @Post()
    async create(@Body() replyForm: ReplyForm): Promise<ReplyForm> {
        return this.replyFormService.create(replyForm);
    }

    @Put(':id')
    async update(@Param('id') id: number, @Body() replyForm: ReplyForm): Promise<ReplyForm> {
        return this.replyFormService.update(id, replyForm);
    }

    @Patch(':id')
    async patch(@Param('id') id: number, @Body() replyForm: Partial<ReplyForm>): Promise<ReplyForm> {
        return this.replyFormService.update(id, replyForm);
    }

    @Delete(':id')
    async remove(@Param('id') id: number): Promise<void> {
        return this.replyFormService.remove(id);
    }
}

